package com.microservice.example.controller;


import com.microservice.example.entity.WUserInfo;
import com.microservice.example.service.IWUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author JohnTang
 * @since 2017-09-30
 */
@RestController
@RequestMapping("/example")
@RefreshScope
public class WUserInfoController {
    @Autowired
    private IWUserInfoService userService;

    @Value("${druid.maxActive}")
    private String config;
    /**
     * 分页 PAGE
     */
    @GetMapping("/list")
    public List<WUserInfo> test() {
        return userService.selectByMap(new HashMap<String, Object>());
    }

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/config")
    public String config() {
        return config;
    }

}
